

IMG_ALLOWED_EXTENSIONS = {'png', 'jpg', 'jpeg', 'gif'}
IMG_ALLOWED_MESSAGE='只允许上传图片文件 (JPG, JPEG, PNG, GIF)'

ROLES = {
    0: "系统管理员",
    1: "本校学生",
    2: "他校学生",
    3: "本校教师",
    4: "院系负责人",
    6: "行政人员",
    7: "后勤人员",
    8: "访客"
}

def default_role():
    return ROLES[8]

def prove_role():
    return [(k, v) for k, v in ROLES.items() if k != 0]

def get_role(index):
    if index in ROLES:
        return ROLES[index]